package com.angel.util;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

public class MyDateFormat {

	public static String format(String formatStr, Timestamp timestamp) {
		SimpleDateFormat sdf = new SimpleDateFormat(formatStr);
		String time = sdf.format(timestamp);
		
		return time;
	}
	
	public static String format(String formatStr, Date date) {
		SimpleDateFormat sdf = new SimpleDateFormat(formatStr);
		String time = sdf.format(date);
		
		return time;
	}
	
	public static void main(String[] args) {
		System.out.println(format("HH:MM", new Date()));
	}
}
